package io;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @description: 字节数组转换为缓冲区
 * @author apple
 * @date 2021/9/12 2:22 下午
 * @version 1.0
 */
public class ByteArrayInputStreamDemo {


    public static void main(String[] args) throws IOException {
        byte[] buffs = "abc".getBytes();
        // buffs缓存起来
        InputStream in = new ByteArrayInputStream(buffs);
        // 从缓存中来读取
        int i = in.read();
        System.out.println(i);
        in.close();
    }

}
